<!--
    Copyright (c) 2009 i>clicker (R) <http://www.iclicker.com/dnn/>

    This file is part of i>clicker Moodle integrate.

    i>clicker Moodle integrate is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    i>clicker Moodle integrate is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with i>clicker Moodle integrate.  If not, see <http://www.gnu.org/licenses/>.
-->
<?php // load up the config values for the block
$block_name = 'block_iclicker'; // must match value from iclicker_service::BLOCK_NAME
$block_iclicker_notify_emails = get_config($block_name, 'block_iclicker_notify_emails');
$block_iclicker_use_national_ws = get_config($block_name, 'block_iclicker_use_national_ws');
$block_iclicker_domain_url = get_config($block_name, 'block_iclicker_domain_url');
$block_iclicker_webservices_url = get_config($block_name, 'block_iclicker_webservices_url');
$block_iclicker_webservices_username = get_config($block_name, 'block_iclicker_webservices_username');
$block_iclicker_webservices_password = get_config($block_name, 'block_iclicker_webservices_password');
$block_iclicker_disable_sync = get_config($block_name, 'block_iclicker_disable_sync');
?>
<div style="text-align: center;">

  <h2><?php print_string('config_general', $block_name); ?>:</h2>
  <p>
    <?php print_string('config_notify_emails', $block_name); ?>:
    <input type="text" name="block_iclicker_notify_emails" size="80" value="<?php echo $block_iclicker_notify_emails?p($block_iclicker_notify_emails):''; ?>" />
  </p>

  <h2><?php print_string('config_webservices', $block_name); ?>:</h2>
  <p>
    <input type="hidden" name="block_iclicker_use_national_ws" value="0" />
    <input type="checkbox" name="block_iclicker_use_national_ws" value="1" <?php
    if (! empty($block_iclicker_use_national_ws)) {
        echo 'checked="checked"';
    } ?> />
    <?php print_string('config_use_national_ws', $block_name); ?>
  </p>
  <p>
    <?php print_string('config_domain_url', $block_name); ?>:
    <input type="text" name="block_iclicker_domain_url" size="80" value="<?php echo $block_iclicker_domain_url?p($block_iclicker_domain_url):''; ?>" />
  </p>
  <p>
    <?php print_string('config_webservices_url', $block_name); ?>:
    <input type="text" name="block_iclicker_webservices_url" size="80" value="<?php echo $block_iclicker_webservices_url?p($block_iclicker_webservices_url):''; ?>" />
  </p>
  <p>
    <?php print_string('config_webservices_username', $block_name); ?>:
    <input type="text" name="block_iclicker_webservices_username" size="25" value="<?php echo $block_iclicker_webservices_username?p($block_iclicker_webservices_username):''; ?>" />
  </p>
  <p>
    <?php print_string('config_webservices_password', $block_name); ?>:
    <input type="text" name="block_iclicker_webservices_password" size="25" value="<?php echo $block_iclicker_webservices_password?p($block_iclicker_webservices_password):''; ?>" />
  </p>
  <p>
    <input type="hidden" name="block_iclicker_disable_sync" value="0" />
    <input type="checkbox" name="block_iclicker_disable_sync" value="1" <?php
    if (! empty($block_iclicker_disable_sync)) {
        echo 'checked="checked"';
    } ?> />
    <?php print_string('config_disable_sync', $block_name); ?>
  </p>

  <p>
    <input type="submit" value="<?php print_string('savechanges'); ?>" />
  </p>
</div>